<template>
  <div>
    <a-input-search
      v-model="textVals"
      placeholder="请选择入库单"
      readOnly
      unselectable="on"
      @search="onSearchGoods">
      <a-button slot="enterButton">选择入库单</a-button>
    </a-input-search>

    <buss-storage-list-modal
      ref="StorageListModal"
      :modal-width="modalWidth"
      :category="category"
      @goodsOk="selectOK"/>
  </div>
</template>
<script>

import BussStorageListModal from "@comp/base/modal/BussStorageListModal";

export default {
  components: {BussStorageListModal},
  props: {
    modalWidth: {
      type: Number,
      default: 850,
      required: false
    },
    category: {
      type: String,
      default: '',
      required: false
    }
  },
  comments: {},
  data() {
    return {
      textVals: ''
    }
  },
  methods: {
    onSearchGoods() {
      this.$refs.StorageListModal.showModal();
    },
    selectOK(rows) {
      this.textVals = "";
      if (rows) {
        this.textVals = rows.name;
        this.$emit("onStorageSelected", rows);
      }
    }
  }
}
</script>